package com.xr.miniprogram.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xr.miniprogram.domain.MiniProgramStandards;
import com.xr.miniprogram.domain.vo.MiniProgramSearchVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface MiniProgramStandardsMapper extends BaseMapper<MiniProgramStandards> {

    /**
     * 根据 关键词 与 排序方式 查询规格VO列表
     * @param keyword
     * @param topic
     * @return
     */
    List<MiniProgramSearchVO> getByKeywordAndTopic(@Param("keyword") String keyword, @Param("topic") Long topic);

    /**
     * 获取规格中有折扣的服务ids
     * @return
     */
    ArrayList<Long> getServiceIdsIsDiscount();

    /**
     * 根据规格id 查询规格下单次数
     * @param serviceStandardsId
     * @return
     */
    Long countStandardOrder(Long serviceStandardsId);
}
